package com.xjj.datarources.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xjj.datarources.pojo.SysPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @name: xjj
 * @date: 2021/5/25 16:02
 */

public interface PermissionMapper extends BaseMapper<SysPermission> {


    @Select("select p.* from sys_permission p inner JOIN sys_role_permission rp on p.id = rp.permission_id left JOIN sys_role r on r.id = rp.role_id where r.id = #{id}")
    List<SysPermission> getPermission(@Param("id") Integer id );


}
